import request from '@/utils/request'

const LApi = {
  list: '/agent/list',
  setHostTag: '/agent/setHostTag',
  setHostProject: '/agent/setHostProject',
  getOnlineHostsByProject: '/agent/getOnlineHostsByProject'
}

export function getAgentList (data) {
  return request({
    url: LApi.list,
    method: 'get',
    params: data || {}
  })
}

export function setHostTag (data) {
  return request({
    url: LApi.setHostTag,
    method: 'post',
    data: data
  })
}

export function setHostProject (data) {
  return request({
    url: LApi.setHostProject,
    method: 'post',
    data: data
  })
}
export function getOnlineHostsByProject (id) {
  return request({
    url: LApi.getOnlineHostsByProject,
    method: 'get',
    params: {projectId: id}
  })
}
